home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 1998 November / IRIX 6.5.2 Base Documentation November 1998.img / usr / share / catman / p_man / cat3 / Xm / XmGetSecondaryResourceData.z / XmGetSecondaryResourceData
Text File  |  1998-10-30  |  8KB  |  133 lines

  1.  
  2.  
  3.  
  4.      XXXXmmmmGGGGeeeettttSSSSeeeeccccoooonnnnddddaaaarrrryyyyRRRReeeessssoooouuuurrrrcccceeeeDDDDaaaattttaaaa((((UUUU3333NNNNXXXXIIII))))XXXX SSSSyyyysssstttteeeeXXXXmmmmmmmmGGGGVVVVeeeettttSSSSeeeeccccoooonnnnddddaaaarrrryyyyRRRReeeessssoooouuuurrrrcccceeeeDDDDaaaattttaaaa((((3333XXXX))))
  5.  
  6.  
  7.  
  8.      NNNNAAAAMMMMEEEE
  9.           XXXXmmmmGGGGeeeettttSSSSeeeeccccoooonnnnddddaaaarrrryyyyRRRReeeessssoooouuuurrrrcccceeeeDDDDaaaattttaaaa - A function that provides access
  10.           to secondary widget resource data
  11.  
  12.      SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  13.           #include <Xm/Xm.h>
  14.           CCCCaaaarrrrddddiiiinnnnaaaallll XXXXmmmmGGGGeeeettttSSSSeeeeccccoooonnnnddddaaaarrrryyyyRRRReeeessssoooouuuurrrrcccceeeeDDDDaaaattttaaaa(
  15.           WWWWiiiiddddggggeeeettttCCCCllllaaaassssssss wwwwiiiiddddggggeeeetttt____ccccllllaaaassssssss,
  16.           XXXXmmmmSSSSeeeeccccoooonnnnddddaaaarrrryyyyRRRReeeessssoooouuuurrrrcccceeeeDDDDaaaattttaaaa ********sssseeeeccccoooonnnnddddaaaarrrryyyy____ddddaaaattttaaaa____rrrreeeettttuuuurrrrnnnn);
  17.  
  18.      VVVVEEEERRRRSSSSIIIIOOOONNNN
  19.           This page documents Motif 2.1.
  20.  
  21.      DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  22.           Some Motif widget classes (such as Gadget, Text, and
  23.           VendorShell) have resources that are not accessible through
  24.           the functions XXXXttttGGGGeeeettttRRRReeeessssoooouuuurrrrcccceeeeLLLLiiiisssstttt and
  25.           XXXXttttGGGGeeeettttCCCCoooonnnnssssttttrrrraaaaiiiinnnnttttRRRReeeessssoooouuuurrrrcccceeeeLLLLiiiisssstttt.  In order to retrieve the
  26.           descriptions of these resources, an application must use
  27.           XXXXmmmmGGGGeeeettttSSSSeeeeccccoooonnnnddddaaaarrrryyyyRRRReeeessssoooouuuurrrrcccceeeeDDDDaaaattttaaaa.
  28.  
  29.           When a widget class has such resources, this function
  30.           provides descriptions of the resources in one or more data
  31.           structures.  XXXXmmmmGGGGeeeettttSSSSeeeeccccoooonnnnddddaaaarrrryyyyRRRReeeessssoooouuuurrrrcccceeeeDDDDaaaattttaaaa takes a widget class
  32.           argument and returns the number of these data structures
  33.           associated with the widget class.  If the return value is
  34.           greater than 0 (zero), the function allocates and fills an
  35.           array of pointers to the corresponding data structures.  It
  36.           returns this array at the address that is the value of the
  37.           _s_e_c_o_n_d_a_r_y__d_a_t_a__r_e_t_u_r_n argument.
  38.  
  39.           The type XXXXmmmmSSSSeeeeccccoooonnnnddddaaaarrrryyyyRRRReeeessssoooouuuurrrrcccceeeeDDDDaaaattttaaaa is a pointer to a structure
  40.           with two members that are useful to an application:
  41.           _r_e_s_o_u_r_c_e_s, of type _X_t_R_e_s_o_u_r_c_e_L_i_s_t, and nnnnuuuummmm____rrrreeeessssoooouuuurrrrcccceeeessss, of
  42.           type CCCCaaaarrrrddddiiiinnnnaaaallll.  The _r_e_s_o_u_r_c_e_s member is a list of the widget
  43.           resources that are not accessible using Xt functions.  The
  44.           nnnnuuuummmm____rrrreeeessssoooouuuurrrrcccceeeessss member is the length of the _r_e_s_o_u_r_c_e_slist.
  45.  
  46.           If the return value is greater than 0 (zero),
  47.           XXXXmmmmGGGGeeeettttSSSSeeeeccccoooonnnnddddaaaarrrryyyyRRRReeeessssoooouuuurrrrcccceeeeDDDDaaaattttaaaaallocates memory that the
  48.           application must free.  Use XXXXttttFFFFrrrreeeeeeee to free the resource list
  49.           in each structure (the value of the _r_e_s_o_u_r_c_e_s member), the
  50.           structures themselves, and the array of pointers to the
  51.           structures (the array whose address is
  52.           _s_e_c_o_n_d_a_r_y__d_a_t_a__r_e_t_u_r_n).
  53.  
  54.           _w_i_d_g_e_t__c_l_a_s_s
  55.                     Specifies the widget class for which secondary
  56.                     resource data is to be retrieved.
  57.  
  58.           _s_e_c_o_n_d_a_r_y__d_a_t_a__r_e_t_u_r_n
  59.                     Specifies a pointer to an array of
  60.  
  61.  
  62.  
  63.      Page 1                                         (printed 10/24/98)
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.      XXXXmmmmGGGGeeeettttSSSSeeeeccccoooonnnnddddaaaarrrryyyyRRRReeeessssoooouuuurrrrcccceeeeDDDDaaaattttaaaa((((UUUU3333NNNNXXXXIIII))))XXXX SSSSyyyysssstttteeeeXXXXmmmmmmmmGGGGVVVVeeeettttSSSSeeeeccccoooonnnnddddaaaarrrryyyyRRRReeeessssoooouuuurrrrcccceeeeDDDDaaaattttaaaa((((3333XXXX))))
  71.  
  72.  
  73.  
  74.                     XXXXmmmmSSSSeeeeccccoooonnnnddddaaaarrrryyyyRRRReeeessssoooouuuurrrrcccceeeeDDDDaaaattttaaaapointers to be returned by
  75.                     this function.  If the widget class has no
  76.                     secondary resource data, for example, if the value
  77.                     returned by the function is 0 (zero), the function
  78.                     returns no meaningful value for this argument.
  79.  
  80.      RRRREEEETTTTUUUURRRRNNNN
  81.           Returns the number of secondary resource data structures
  82.           associated with this widget class.
  83.  
  84.      EEEEXXXXAAAAMMMMPPPPLLLLEEEE
  85.           The following example uses XXXXmmmmGGGGeeeettttSSSSeeeeccccoooonnnnddddaaaarrrryyyyRRRReeeessssoooouuuurrrrcccceeeeDDDDaaaattttaaaa to
  86.           print the names of the secondary resources of the Motif Text
  87.           widget and then frees the data allocated by the function:
  88.  
  89.           XmSecondaryResourceData * block_array;
  90.           Cardinal num_blocks, i, j;
  91.           if (num_blocks = XmGetSecondaryResourceData (xmTextWidgetClass,
  92.                                                        &block_array)) {
  93.             for (i = 0; i < num_blocks; i++) {
  94.               for (j = 0; j < block_array[i]->num_resources; j++) {
  95.                 printf("%s\n", block_array[i]->resources[j].resource_name);
  96.               }
  97.               XtFree((char*)block_array[i]->resources);
  98.               XtFree((char*)block_array[i]);
  99.             }
  100.             XtFree((char*)block_array);
  101.           }
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.      Page 2                                         (printed 10/24/98)
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.